package com.zdf.license.verify.config;

import com.zdf.license.verify.aspect.VLicenseAspect;
import com.zdf.license.verify.service.LicenseVerifyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Slf4j
@Configuration
@EnableConfigurationProperties({LicenseVerifyProperties.class})
@Import({
        CheckLicenseConfigure.class
})
public class LicenseVerifyAutoConfigure {

    public LicenseVerifyAutoConfigure(){
        log.info("证书校验服务初始化...");
    }

    @Bean
    public VLicenseAspect vLicenseAspect(LicenseVerifyProperties properties){
        return new VLicenseAspect(properties);
    }

    @Bean
    public LicenseVerifyService licenseVerifyService(LicenseVerifyProperties properties){
        return new LicenseVerifyService(properties);
    }

}
